#pragma once

#include <grpc++/grpc++.h>
#include "../../proto/rpc.grpc.pb.h"
#include "../action.hpp"
#include "rsp_range.hpp"


using grpc::ClientAsyncResponseReader;
using etcdserverpb::RangeResponse;

namespace etcdv3 {
class AsyncGetAction : public Action {
public:
    AsyncGetAction(const ActionParameters& param);
    AsyncRangeResponse ParseResponse();
private:
    RangeResponse reply;
    std::unique_ptr<ClientAsyncResponseReader<RangeResponse>> reader;
};

}
